home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 386 / utility / config.s < prev    next >
Text File  |  1985-11-19  |  3KB  |  76 lines

  1.  ; Program Name: CONFIG.S
  2.  
  3.  ; Assembly Instructions:
  4.  
  5.  ;     Assemble in PC-relative mode and save with a PRG extension.  Move
  6.  ; CONFIG.PRG to the AUTO folder of the boot disk.
  7.  
  8.  ; Program Purpose:
  9.  
  10.  ;     Configures system variables.
  11.  
  12. mainline:
  13.  lea        stack, a7           ; Point A7 to this program's stack.
  14.  
  15. enter_supervisor_mode:
  16.  move.l     #0, -(sp)           ; The zero turns on supervisor mode.
  17.  move.w     #$20, -(sp)         ; Function = super = GEMDOS $20.
  18.  trap       #1                  ; Supervisor stack pointer returned in D0.
  19.  addq.l     #6, sp
  20.  
  21.  ; Algorithm 1:
  22.  
  23.  ; Turns off keyclick sound.  Refer to page 254 of the Internals book.  The
  24.  ; system variable at address $484 is a byte length variable.  The bits of
  25.  ; this variable have the meanings as indicated in the Internals book.  The
  26.  ; bit of interest is #0.  When this bit is a one, the computer emits a
  27.  ; click each time a key is pressed.  When the bit is a zero, these clicks
  28.  ; are not emitted.  A zero is placed in this bit by replacing the content
  29.  ; of the byte at $484 (which is 7 before the replacement, if key click is
  30.  ; enabled) with $6.
  31.  
  32. disable_key_click:
  33.  move.b     #6, $484            ; Refer to page 254 of the Internals book.
  34.  
  35.  ; Algorithm 2:
  36.  
  37.  ;     Performs the printer installation that is accomplished by CONTROL.ACC.
  38.  ; The printer configuration table consists of one word, stored at $E4A.
  39.  ; The bits of this word have the following meanings:
  40.  
  41.  ;            BIT  MEANING IF ZERO  MEANING IF ONE
  42.  ;            ---  ---------------  --------------
  43.  ;             0   Dot matrix       Daisy printer
  44.  ;             1   Black/white      Color printer
  45.  ;             2   1280 dots/line   960 dots/line
  46.  ;             3   Draft mode       Final mode
  47.  ;             4   Printer port     Modem port
  48.  ;             5   Continuous feed  Single sheet
  49.  
  50.  ; Bits 6 through 15 are not used.
  51.  
  52. install_printer:
  53.  move.w     #$4, $E4A
  54.  
  55.  ; Algorithm 3:
  56.  
  57.  ; Turns off disk write verify.
  58.  
  59. disable_write_verify:
  60.  move.w     #0, $444            ; Refer to page 252 of the Internals book.
  61.  
  62. return_to_user_mode:
  63.  move.l     d0, -(sp)           ; Restore "before call" SSP.
  64.  move.w     #$20, -(sp)         ; Function = super = GEMDOS $20.
  65.  trap       #1                 
  66.  addq.l     #6, sp
  67.  
  68. terminate:
  69.  move.w     #0, -(sp)           ; Function = p_term_old = GEMDOS $0.
  70.  trap       #1                  ; GEMDOS call.
  71.  
  72.              ds.l    24         ; Stack.
  73. stack:       ds.l     1         ; Address of stack.
  74. program_end: ds.l     0
  75.  end